import request from "@/utils/request";
//如果方法比较多 那么可以使用定义参数的方式封装
const api_name="/eduservice/pageTeacherCondition"
export default {
  //讲师列表分页查询
  getTeacherListPage(current, limit, teacherQuery) {
    return request({
      url: `${api_name}/${current}/${limit}`,
      method: "post",
      //teacherQuery条件对象 后端使用RequestBody 获取数据
      //data表示把对象转换为json进行传递到接口里面
      data: teacherQuery
    });
  },
  //实现讲师的删除y
  deleteTeacher(id) {
    return request({
      url: `/eduservice/delete/${id}`,
      method: "delete"
    });
  },
  //添加讲师
  addTeacher(teacher) {
    return request({
      url: `/eduservice/addTeacher`,
      method: "post",
      data: teacher
    });
  },
  //根据id查询讲师
  getTeacherInfo(id) {
    return request({
      url: `/eduservice/getTeacher/${id}`,
      method: "get"
    });
  },
  //修改讲师
  updateTeacherInfo(teacher) {
    return request({
      url: `/eduservice/updateTeacher`,
      method: "post",
      data: teacher
    });
  }
};
